gdk/quartz: Fix mixup in attributes usage creating window implementation
authorThibault Saunier <tsaunier@gnome.org>
Sun, 22 Feb 2015 12:01:17 +0000 (13:01 +0100)
committerThibault Saunier <tsaunier@gnome.org>
Sun, 22 Feb 2015 14:50:39 +0000 (15:50 +0100)
First, attributes can be NULL (which is always the case when calling
gdk_window_ensure_native) so do not unconditionally dereference it.

Then the window_type should be taken directly from the GdkWindow as
in other backends (such as the X11 one for example).

https://bugzilla.gnome.org/show_bug.cgi?id=744942

gdk/quartz/gdkwindow-quartz.c

index 2a2444ef74f40aa1612fbac1f2326883cd053e12..6306034bcef8389d28ad62671633ff4b126d7fc6 100644 (file)
@@ -818,7 +818,7 @@ _gdk_quartz_display_create_window_impl (GdkDisplay    *display,
 
   impl->view = NULL;
 
-  switch (attributes->window_type)
+  switch (window->window_type)
     {
     case GDK_WINDOW_TOPLEVEL:
     case GDK_WINDOW_TEMP:
@@ -846,8 +846,9 @@ _gdk_quartz_display_create_window_impl (GdkDisplay    *display,
                                    window->width,
                                    window->height);
 
-        if (attributes->window_type == GDK_WINDOW_TEMP ||
-            attributes->type_hint == GDK_WINDOW_TYPE_HINT_SPLASHSCREEN)
+        if (window->window_type == GDK_WINDOW_TEMP ||
+            ((attributes_mask & GDK_WA_TYPE_HINT) &&
+              attributes->type_hint == GDK_WINDOW_TYPE_HINT_SPLASHSCREEN))
           {
             style_mask = NSBorderlessWindowMask;
           }